﻿using System;
using System.Linq.Expressions;

namespace fluentvaly
{
    public class InvariantValidator<T> : BaseValidationSetUp
    {
        public InvariantValidator(bool throwsException, string defaultInvalidationMessage, InvalidationReasons defaultInvalidationReason) : base(throwsException, defaultInvalidationMessage, defaultInvalidationReason)
        {
        }

        public InvariantValidator(bool throwsException) : base(throwsException)
        {
        }

        public IValidationStatementSetUp<T, TMember> EnsureThat<TMember>(Expression<Func<T, TMember>> member)
        {
            var validator = new MemberValidator<T, TMember>(member, DefaultInvalidationMessage, DefaultInvalidationReason);

            AddMemeberValidator(validator);

            return validator;
        }

        public void EnsureValid<TMember>(Expression<Func<T, TMember>> member)
        {
            
        }

        public override Type GetDefinedType()
        {
            return typeof (T);
        }
    }
}
